//
//  ViewController.m
//  CAGradientLayer
//
//  Created by Xwoder on 17/1/31.
//  Copyright © 2017年 Xwoder. All rights reserved.
//

#import "ViewController.h"

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    
    CAGradientLayer *layer = [CAGradientLayer layer];
    layer.frame = self.view.bounds;
    // 颜色梯度
    layer.colors = @[(id)[UIColor clearColor].CGColor, (id)[UIColor blackColor].CGColor];
    layer.startPoint = CGPointZero;
    layer.endPoint = CGPointMake(1, 1);
    [self.view.layer addSublayer:layer];
}

@end
